package servicesImp.specific;


import base.response.OffsetLimitPage;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import services.specific.ExtractExpertServices;
import wt.dao.specific.ExtractExpertMapper;
import wt.entity.specific.ExtractExpert;

import java.util.Date;
import java.util.List;


/**
 * Created by Administrator on 2017/9/13.
 */
@Service
public class ExtractExpertServicesImp implements ExtractExpertServices {

    @Autowired
    ExtractExpertMapper extractExpertMapper;


    /**
     * 手动抽取专家信息
     *
     * @param name
     * @param outLander
     * @param gradeList
     * @param majorNumList
     * @param itemId
     * @param startTime
     * @param endTime
     * @return
     * @throws Exception
     */
    public List<ExtractExpert> selectManuallyExtractExpert(String name, Short outLander, List<String> gradeList, List<String> majorNumList, String itemId,String affiliateCompany, Date startTime, Date endTime) throws Exception {

        return extractExpertMapper.selectManuallyExtractExpert(name, outLander, gradeList, majorNumList, itemId,affiliateCompany, startTime, endTime);

    }

    /**
     * 手动抽取专家信息
     *
     * @param name
     * @param outLander
     * @param gradeList
     * @param majorNumList
     * @param itemId
     * @param startTime
     * @param endTime
     * @param offset
     * @param limit        @return
     * @throws Exception
     */
    public OffsetLimitPage selectManuallyExtractExpert(String name, Short outLander, List<String> gradeList, List<String> majorNumList, String itemId ,String affiliateCompany, Date startTime, Date endTime, Integer offset, Integer limit) throws Exception {
        PageHelper.offsetPage(offset, limit);
        List<ExtractExpert> extractExpertList = extractExpertMapper.selectManuallyExtractExpert(name, outLander, gradeList, majorNumList, itemId,affiliateCompany, startTime, endTime);
        return new OffsetLimitPage((Page) extractExpertList);
    }


    /**
     * 自动动抽取专家信息
     *
     * @param name
     * @param outLander
     * @param gradeList
     * @param majorNumList
     * @param itemId
     * @param startTime
     * @param endTime
     * @return
     * @throws Exception
     */
    public List<ExtractExpert> selectAutomaticExtractExpert(String name, Short outLander, List<String> gradeList, List<String> majorNumList, String itemId,String affiliateCompany, Date startTime, Date endTime) throws Exception {
        return extractExpertMapper.selectAutomaticExtractExpert(name, outLander, gradeList, majorNumList, itemId,affiliateCompany, startTime, endTime);
    }


    /**
     * 自动动抽取专家信息
     * @param name
     * @param outLander
     * @param gradeList
     * @param majorNumList
     * @param itemId
     * @param affiliateCompany
     * @param startTime
     * @param endTime
     * @param offset
     * @param limit
     * @return
     * @throws Exception
     */
    public OffsetLimitPage selectAutomaticExtractExpert(String name, Short outLander, List<String> gradeList, List<String> majorNumList, String itemId,String  affiliateCompany, Date startTime, Date endTime, Integer offset, Integer limit) throws Exception {
        PageHelper.offsetPage(offset, limit);
        List<ExtractExpert> extractExpertList = extractExpertMapper.selectAutomaticExtractExpert(name, outLander, gradeList, majorNumList, itemId,affiliateCompany, startTime, endTime);
        return new OffsetLimitPage((Page) extractExpertList);
    }
}
